<?php
	class pagesModel extends CI_Model
	{
		public function __construct()
		{
			parent::__construct();
		}
		
		public function find($page)
		{
			$query = $this->db->get_where('userpages',array('key' => $page));
			if($query->num_rows > 0)
			{
				return $query->row();
			}
		}
		
		public function save($page)
		{
			$this->db->where('key', $page);
			$query = $this->db->update('userpages', array('content' => $this->input->post('content')));
			
			if($query)
			{
				return true;
			}
		}
	}
?>